POV-Ray : Newsgroups : povray.advanced-users : Object Oriented POV code : Re: Object Oriented POV code Server Time
29 Jul 2024 04:19:59 EDT (-0400)
  Re: Object Oriented POV code  
From: Warp
Date: 24 Feb 2004 05:30:30
Message: <403b27c6@news.povray.org>
Darren New <dne### [at] sanrrcom> wrote:
> Warp wrote:
> >   So because the makers of the compiler are lazy they force the
> > user of the language to make bad code?

> Correctamundo! Welcome to commercial programming!

  If I'm not completely mistaken this thread was about what would be
useful features and what would be unnecessary features for a theoretical
future OO scripting language for POV-Ray.
  Last time I checked POV-Ray was not commercial and the developers didn't
have really tight deadlines.

> >   C++ does multiple inheritance quite efficiently, and even if it didn't,
> > why should it matter? You just need to know how heavy multiple inheritance
> > is and then decide whether to use it or not in your application.

> Spoken like someone who writes all his own code without using someone 
> else's libraries. Very good. :-)

  I do use someone else's libraries a lot. For instance, I use the STL
libraries in almost every single C++ program I make. I do know most of
the advantages and disadvantages (including bottlenecks) in them.

> >   One could argue that virtual functions are inefficient because they
> > produce internally an indirect function call (subroutine call to an
> > address got from behind a pointer got from behind a pointer), which
> > potentially make them slightly slower than regular function calls.

> Of course, that assumes the compiler's too stupid to turn this into a 
> direct call in the case that there's no actual dynamic dispatch in the 
> program. Same kind of thing. Lazy compiler writers. ;-)

  If a member function has been declared virtual in C++, there's no way
the compiler can know at compile time there will be no more than one
derived class implementing that function. It can't even theoretically
check this at linking time because some code in a dynamic library (which
may change in the future) may implement that virtual function.

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.